﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using Base = System.Web.UI.Page;

namespace JQuery.Net
{
    public class Page
        : Base
    {
        internal ResourceManager ScriptIncludes = null;

        public Page()
            : base()
        {
            ScriptIncludes = new ResourceManager();
        }

        #region properties
        public ResourceManager ResourceIncludes
        {
            get { return ((Base)this).ResourceIncludes(); }
        }

        private string PageKey
        {
            get { return ((Base)this).GetPageKey(); }
        }

        protected ExtensionContainer Extensions
        {
            get
            {
                return Module.Composition;
            }
        }
        #endregion

        #region methods
        public override void Dispose()
        {
            ScriptIncludes.Clear();
            ScriptIncludes = null;
            // proceed to clean up the rest of the page
            base.Dispose();
        }

        public void RegisterResourceInclude(string id, string uri, string type = "text/javascript", int ordinal = 0, Assembly assembly = null)
        {
            ((Base)this).RegisterResourceInclude(id, uri, type, ordinal, assembly);
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
        }
        #endregion
    }
}
